////////////////////////////////////////////////////////////////////////////
/// Name: droid.cpp
/// Author: B. Gian James <gian@BattleDroids.net>
/// Description: This is the droid file.
///
/// $Id: droid.cpp,v 1.2 2009/08/28 22:55:17 gian Exp $
///////////////////////////////////////////////////////////////////////////
#include "droid.h"
#include <avr/eeprom.h>
#include <string.h>

/////////////////////////////////////////////////////////[ BattleDroid
uint8
BattleDroid::Init()
{
	uint8	ver = 0;
	if (eeprom_read_byte((uint8*)ver) != VERSION)
	{
		//memset((void*)&_name,0,15);
		//memset((void*)&_pilot,0,15);
		return 0;
	}
	else
	{
		eeprom_read_block((BattleDroid*)this, (void*)EE_DROID_STATS, sizeof(BattleDroid));
		return 1;
	}
}

BattleDroid::BattleDroid()
{
		_armor = 0;
		_communication = 0;
		_computation = 0;
		_mobility = 0;
		_xp = 0;
		_ver = 1;
		_verminor = 0;
		_energy = 1;
		_class = 0;
		_damageControl = 0;
		_defense = 0;
		_emi = 0;
		_explosive = 0;
		_initiative = 0;
		_mechanical = 0;
		_pilot = NULL;
		_signature.sig = SIG_VISUAL;
		_signature.lvl = 10;
		_weight = 0;
}

